#include "checksum_out.h"
#include <stdint.h>
#include "adler32.h"
#include "checksum_16.h"
#include "checksum_32.h"
#include "checksum_8.h"
#include "checksum_xor.h"
#include "fletcher16.h"
#include "rolling_checksum.h"
#include "log.h"

#define LOG_TAG "checksum"

void CHECKSUM_Out(uint8_t *data, size_t len)
{
    uint32_t out = MakeChecksum32(data, len);
    LOGI(LOG_TAG, "CHECKSUM32: 0x%08x\n", out);
}

void CHECKSUM16_Out(uint8_t *data, size_t len)
{
    uint16_t out = MakeChecksum16(data, len);
    LOGI(LOG_TAG, "CHECKSUM16: 0x%04x\n", out);
}

void CHECKSUM8_Out(uint8_t *data, size_t len)
{
    uint8_t out = MakeChecksum8(data, len);
    LOGI(LOG_TAG, "CHECKSUM8: 0x%02x\n", out);
}

void CHECKSUM_XOR_Out(uint8_t *data, size_t len)
{
    uint8_t out = MakeChecksumXor(data, len);
    LOGI(LOG_TAG, "CHECKSUM_XOR: 0x%02x\n", out);
}

void FLETCHER16_Out(uint8_t *data, size_t len)
{
    uint16_t out = MakeFletcher16(data, len);
    LOGI(LOG_TAG, "FLETCHER16: 0x%04x\n", out);
}

void ADLER32_Out(uint8_t *data, size_t len)
{
    uint32_t out = MakeAdler32(data, len);
    LOGI(LOG_TAG, "ADLER32: 0x%08x\n", out);
}

void ROLLING_Out(uint8_t *data, size_t len)
{
    uint32_t out = MakeRollingChecksum(data, len);
    LOGI(LOG_TAG, "ROLLING_SUM: 0x%08x\n", out);
}